import { Column, Entity, PrimaryColumn, PrimaryGeneratedColumn, OneToMany, ManyToOne, JoinColumn, CreateDateColumn } from "typeorm";
import { ApiProperty } from '@nestjs/swagger';
import { BaseEntity } from 'src/common/entities/base';
import {KzAccountEntity} from './kz-account.entity'

@Entity('kz_site', {
    comment: '快站站点信息表',
  })
export class KzSiteEntity extends BaseEntity {
    @ApiProperty({ type: String, description: '站点ID' })
    @PrimaryColumn({ type: 'varchar', name: 'site_id', length: 50, comment: '站点ID' })
    public siteId: string;

    @Column({ type: 'varchar', name: 'site_name', length: 30, comment: '站点名称' })
    public siteName: string;

    @Column({ type: 'varchar', name: 'site_domain', length: 250, comment: '站点域名' })
    public siteDomain: string;

    @Column({ type: 'varchar', name: 'site_status', length: 30, comment: '站定发布状态' })
    public siteStatus: string;

    @Column({ type: 'varchar', name: 'package_name', length: 30, comment: '站点套餐类型' })
    public packageName: string;

    @Column({ type: 'int', name: 'package_remaining_days', comment: '站点套餐剩余天数' })
    public packageRemainingDays: string;

    @Column({ type: 'date', name: 'package_expiry_date',  default: null, comment: '站点套餐到期日期' })
    public packageExpiryDate: Date;

    @ManyToOne(() => KzAccountEntity, account => account.id)
    @JoinColumn({name: 'account_id'})
    public account: KzAccountEntity;
}